﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using MyBet.Web.DAL;
using System.Web.Security;
using System.Web.Profile;
using System.ComponentModel.DataAnnotations;
using System.ServiceModel.DomainServices.Hosting;
using System.ServiceModel.DomainServices.Server;
using System.Xml.Serialization;
using System.Runtime.Serialization;

namespace MyBet.Web
{
    [DataContractAttribute(IsReference = true)]
    [Serializable()]
    public class ChampionshipObject
    {
        private int _championshipId;
        private string _name;
        private byte[] _image;

        [Key()]
        [DataMemberAttribute()]
        public int ChampionshipId
        {
            get { return _championshipId; }
            set { _championshipId = value; }
        }
        
        [DataMemberAttribute()]
        public string Name
        {
            get { return _name; }
            set { _name = value; }
        }

        [DataMemberAttribute()]
        public byte[] Image
        {
            get { return _image; }
            set { _image = value; }
        }

        public static ChampionshipObject CopyFrom(Championships d)
        {
            ChampionshipObject championship = new ChampionshipObject();
            championship.ChampionshipId = d.ChampionshipId;
            championship.Name = d.Name;
            championship.Image = d.Icon;
            return championship;
        }
    }
}